package com.isorf.controller;


import com.isorf.pojo.student;
import com.isorf.pojo.teacher;

import com.isorf.service.teacherservice;
import com.isorf.util.responseresult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@Api(tags = "教师接口" )

@RestController
@RequestMapping("/teacher")
public class teachercontroller
{
@Autowired
      private teacherservice teacherservice;

    @ApiOperation("获得全部教师信息")
@RequestMapping("/getallteachers")
    public responseresult<List<teacher>> getallteachers()
    {
        List<teacher> teacher = teacherservice.getallteachers();

        if (teacher == null) {
            return responseresult.failure(508, "没有教师信息");
        }else {
            return responseresult.success(200, "查询成功", teacher);
    }
    }

}